
function BattleSpecialMageCustom()
{
RenderMap();

  BattleName(); 
  DrawPlayerStats();
  
  var BattleMenumag = new Menu();
  BattleMenumag.font         = Font;
  BattleMenumag.window_style = WindowStyle;
  BattleMenumag.arrow        = Arrow;

  if (Player.cmagic.telekinesispres == true)
  {
  BattleMenumag.addItem(Player.cmagic.telekinesis, BattleSpecialMageTelekinesis);
  }
  if (Player.cmagic.dieasepres == true)
  {
  BattleMenumag.addItem(Player.cmagic.diease, BattleSpecialMageDiease);
  }  
  if (Player.cmagic.explodepres == true)
  {
  BattleMenumag.addItem(Player.cmagic.explode, BattleSpecialMageExplode);
  }
  if (Player.cmagic.explode2pres == true)
  {
  BattleMenumag.addItem(Player.cmagic.explode2, BattleSpecialMageExplode2);
  }
  if (Player.cmagic.plaguepres == true)
  {
  BattleMenumag.addItem(Player.cmagic.plague, BattleSpecialMagePlague);
  }
  if (Player.cmagic.flarepres == true)
  {
  BattleMenumag.addItem(Player.cmagic.flare, BattleSpecialMageFlare);
  }

  if (Player.cmagic.holdpres == true)
  {
  BattleMenumag.addItem(Player.cmagic.hold, BattleSpecialMageHold);
  }
  if (Player.cmagic.multiuppres == true)
  {
  BattleMenumag.addItem(Player.cmagic.multiup, BattleSpecialMageMultiup);
  }
  if (Player.cmagic.mpregainpres == true)
  {
  BattleMenumag.addItem(Player.cmagic.mpregain, BattleSpecialMageMpregain);
  }
  if (Player.cmagic.anglicraypres == true)
  {
  BattleMenumag.addItem(Player.cmagic.anglicray, BattleSpecialMageAnglicray);
  }
  BattleMenumag.addItem("Cancel", GoToActivePlayer);
  BattleMenumag.execute(5, 355, 235, 120);
}
function BattleSpecialMageTelekinesis()
{
CheckMp("Lv1");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.telekinesis;
  Player.attacktype = ""
  BattleSpecialMageBtarget()
  }
}

function BattleSpecialMageDiease()
{
CheckMp("Lv1.5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.diease;
  Player.attacktype = "Sickness"
  BattleSpecialMageBtarget()
  }
}
function BattleSpecialMageExplode()
{
CheckMp("Lv3");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.explode;
  Player.attacktype = "Fire"
  TakeoutDamage();
  }
}
function BattleSpecialMageExplode2()
{
CheckMp("Lv4");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.explode2;
  Player.attacktype = "Fire"
  TakeoutDamage();
  }
}
function BattleSpecialMagePlague()
{
CheckMp("Lv4.5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.plague;
  Player.attacktype = "Sickness"
  TakeoutDamage();
  }
}
function BattleSpecialMageFlare()
{
CheckMp("Lv5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.flare;
  Player.attacktype = ""
  BattleSpecialMageBtarget()
  }
}
function BattleSpecialMageAnglicray()
{
CheckMp("Lv5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.anglicray;
  Player.attacktype = "Holy"
  BattleSpecialMageWEtarget();
  }
}
function BattleSpecialMageHold()
{
CheckMp("Lv2");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.hold;
  BattleSpecialMageWEtarget()
  }
}
function BattleSpecialMageMultiup()
{
CheckMp("Lv3.5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.multiup;
  BattleSpecialMageWtarget()
  }
}
function BattleSpecialMageMpregain()
{
CheckMp("Lv3.5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = Player.cmagic.mpregain;
  BattleSpecialMageWtarget()
  }
}

function BattleSpecialSoldierTech()
{
RenderMap();

  BattleName(); 
  DrawPlayerStats();
  
  var BattleMenuItem = new Menu();
  BattleMenuItem.font         = Font;
  BattleMenuItem.window_style = WindowStyle;
  BattleMenuItem.arrow        = Arrow;
  if (Player.active == "Player1")
  {
    if (Playersoldier.dash == true)
    {
    BattleMenuItem.addItem("Dash", BattleSpecialSoldierDash);
    }
    if (Playersoldier.dualcombo == true)
    {
    BattleMenuItem.addItem("Dual Combo", BattleSpecialSoldierDualcombo);
    }
    if (Playersoldier.sworddrain == true)
    {
    BattleMenuItem.addItem("Sword Drain", BattleSpecialSoldierSworddrain);
    }
    if (Playersoldier.charge == true)
    {
    BattleMenuItem.addItem("Charge", BattleSpecialSoldierCharge);
    }
    if (Playersoldier.quadslice == true)
    {
    BattleMenuItem.addItem("Quad Slice", BattleSpecialSoldierQuadslice);
    }
  }
  else if (Player.active == "Player2")
  {
    if (Player2soldier.dash == true)
    {
    BattleMenuItem.addItem("Dash", BattleSpecialSoldierDash);
    }
    if (Player2soldier.dualcombo == true)
    {
    BattleMenuItem.addItem("Dual Combo", BattleSpecialSoldierDualcombo);
    }
    if (Player2soldier.sworddrain == true)
    {
    BattleMenuItem.addItem("Sword Drain", BattleSpecialSoldierSworddrain);
    }
    if (Player2soldier.charge == true)
    {
    BattleMenuItem.addItem("Charge", BattleSpecialSoldierCharge);
    }
    if (Player2soldier.quadslice == true)
    {
    BattleMenuItem.addItem("Quad Slice", BattleSpecialSoldierQuadslice);
    }
  }
  else if (Player.active == "Player3")
  {
    if (Player3soldier.dash == true)
    {
    BattleMenuItem.addItem("Dash", BattleSpecialSoldierDash);
    }
    if (Player3soldier.dualcombo == true)
    {
    BattleMenuItem.addItem("Dual Combo", BattleSpecialSoldierDualcombo);
    }
    if (Player3soldier.sworddrain == true)
    {
    BattleMenuItem.addItem("Sword Drain", BattleSpecialSoldierSworddrain);
    }
    if (Player3soldier.charge == true)
    {
    BattleMenuItem.addItem("Charge", BattleSpecialSoldierCharge);
    }
    if (Player3soldier.quadslice == true)
    {
    BattleMenuItem.addItem("Quad Slice", BattleSpecialSoldierQuadslice);
    }
  }
  BattleMenuItem.addItem("Cancel", GoToActivePlayer);  
  BattleMenuItem.execute(5, 355, 235, 120);
}
function BattleSpecialSoldierDash()
{
CheckMpDash();
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = "Dash";
  Player.techloop = 1;
  Player.techmp = true;
  Player.techpower = 0.9;
  BattleSpecialSoldierTarget()
  }
}
function BattleSpecialSoldierDualcombo()
{
CheckMp("Lv1");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = "Dual Combo";
  Player.techloop = 2;
  Player.techmp = true;
  Player.techpower = 0.7;
  BattleSpecialSoldierTarget()
  }
}
function BattleSpecialSoldierSworddrain()
{
CheckMp("Lv1.5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = "Sword Drain";
  Player.techpower = 0.9;
  BattleSpecialSoldierTarget()
  }
}
function BattleSpecialSoldierCharge()
{
CheckMp("Lv2");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = "Charge";
  Player.techpower = 0.9;
  BattleMenu_TechMonster1();
  }
}
function BattleSpecialSoldierQuadslice()
{
CheckMp("Lv2.5");
  if (Player.needmp > Player.actmp)
  {
  Talk_Window("You don't have enough Mp!", "blank.png");
  GoToActivePlayer();
  }
  else
  {    
  Player.temp = "Quad Slice";
  Player.techloop = 4;
  Player.techmp = true;
  Player.techpower = 0.9;
  BattleSpecialSoldierTarget()
  }
}
function BattleSpecialSoldierTarget()
{
  Player.BMenuTemp = true;

  LoadFightStats();
  RenderMap();
  
    BattleName();
    DrawPlayerStats();

    var BattleMenu = new BMenu();
    BattleMenu.font         = Font;
    BattleMenu.window_style = WindowStyle;
    BattleMenu.arrow        = Arrow;
    if (Monster1.hp >= 1)
    {
    BattleMenu.addItem(Monster1.name,  BattleMenu_TechMonster1);
    }
    if (Monster2.hp >= 1)
    {
    BattleMenu.addItem(Monster2.name, BattleMenu_TechMonster2);
    }
    if (Monster3.hp >= 1)
    {
    BattleMenu.addItem(Monster3.name, BattleMenu_TechMonster3);
    }
    if (Monster4.hp >= 1)
    {
    BattleMenu.addItem(Monster4.name, BattleMenu_TechMonster4);
    }
    BattleMenu.addItem("Cancel", GoToActivePlayer);
    BattleMenu.execute(5, 355, 235, 120);
}

function BattleMenu_TechMonster1()
{
  if (Player.techmp == true)
  {
    if (Player.temp == "Dual Combo")
    {
    ReduceMp("Lv1");
    Player.techmp = false;
    }
    else if (Player.temp == "Quad Slice")
    {
    ReduceMp("Lv2.5");
    Player.techmp = false;
    }
    else if (Player.temp == "Dash")
    {
    ReduceMpDash();
    Player.techmp = false;

    Player.tempposx = Monster1.posx;
    Player.tempposy = Monster1.posy;
    DashFrames();
    }
  }

Monster1.temppres = false;
Monster2.temppres = false;
Monster3.temppres = false;
Monster4.temppres = false;
  if (Player.temp == "Sword Drain")
  { 
    ReduceMp("Lv1.5");

    Player.tempposx = Monster1.posx;
    Player.tempposy = Monster1.posy;
    SwordDrainFrames();

    Battle.math = Math.random()/5 + Player.techpower;
    RenderMap();

    Player.attackdamage = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster1.defence);
      if (Player.attackdamage > Monster1.hp)
      {
      Player.attackdamage = Monster1.hp;
      }
    Monster1.hp = Monster1.hp - Player.attackdamage;

    WindowStyle.drawWindow(5, 5, 235, 12);
    Font.drawText(7, 7, Player.temp);

    RenderMap();
    Font.drawTextBox (Monster1.posx, Monster1.posy, 500, 100, 5, Player.attackdamage);
    DrawPlayerStats();
    BattleName();
    FlipScreen();
    Delay(1000);
    HealPerson(Player.attackdamage);
    IsMonster1Dead(); 
    BattleMenu_Itemused();
  }
  else if (Player.temp == "Charge")
  {
  LoadFightStats();
  ReduceMp("Lv2");  

  RenderMap();
  WindowStyle.drawWindow(5, 5, 235, 12);
  Font.drawText(7, 7, Player.temp);
  DrawPlayerStats();
  BattleName();
  FlipScreen();
  Delay(200);

  ChargeFrames();

  RenderMap();
  WindowStyle.drawWindow(5, 5, 235, 12);
  Font.drawText(7, 7, Player.temp);
  DrawPlayerStats();
  BattleName();

    if (Monster1.hp > 0)
    {
    Battle.math = Math.random()/5 + Player.techpower;
    Player.attackdamage = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster1.defence);
    Monster1.hp = Monster1.hp - Player.attackdamage;
    Font.drawTextBox (Monster1.posx, Monster1.posy, 500, 100, 5, Player.attackdamage);
    Monster1.temppres = true;
    }
    if (Monster2.hp > 0)
    {
    Battle.math = Math.random()/5 + Player.techpower;
    Player.attackdamage2 = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster2.defence);
    Monster2.hp = Monster2.hp - Player.attackdamage2;
    Font.drawTextBox (Monster2.posx, Monster2.posy, 500, 100, 5, Player.attackdamage2);    
    Monster2.temppres = true;
    }
    if (Monster3.hp > 0)
    {
    Battle.math = Math.random()/5 + Player.techpower;
    Player.attackdamage3 = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster3.defence);
    Monster3.hp = Monster3.hp - Player.attackdamage3;
    Font.drawTextBox (Monster3.posx, Monster3.posy, 500, 100, 5, Player.attackdamage3);    
    Monster3.temppres = true;
    }
    if (Monster4.hp > 0)
    {
    Battle.math = Math.random()/5 + Player.techpower;
    Player.attackdamage4 = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster4.defence);
    Monster4.hp = Monster4.hp - Player.attackdamage4;
    Font.drawTextBox (Monster4.posx, Monster4.posy, 500, 100, 5, Player.attackdamage4);    
    Monster4.temppres = true;
    }
    FlipScreen();
    Delay(1000);

    if (Monster1.temppres == true)
    {
      if (Monster1.hp <= 0)
      {
      Battle.monsternum = Battle.monsternum - 1;
      Destroy("Monster1");
      }
    }
    if (Monster2.temppres == true)
    {
      if (Monster2.hp <= 0)
      {
      Battle.monsternum = Battle.monsternum - 1;
      Destroy("Monster2");
      }
    }
    if (Monster3.temppres == true)
    {
      if (Monster3.hp <= 0)
      {
      Battle.monsternum = Battle.monsternum - 1;
      Destroy("Monster3");
      }
    }
    if (Monster4.temppres == true)
    {
      if (Monster4.hp <= 0)
      {
      Battle.monsternum = Battle.monsternum - 1;
      Destroy("Monster4");
      }
    }
  Delay(400);
  RenderMap();
  BattleMenu_Itemused();
  }
  else
  {  
    if (Player.techloop > 0)
    {
      if (Player.temp == "Dash")
      {
      }
      else
      {
      ShowPersonFight();
      Player.tempposx = Monster1.posx;
      Player.tempposy = Monster1.posy;
      SlashFrames("Slash", 20, 20);
      }
    
    Battle.math = Math.random()/5 + Player.techpower;

    Player.attackdamage = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster1.defence);
    Monster1.hp = Monster1.hp - Player.attackdamage;

    RenderMap();
    Font.drawTextBox (Monster1.posx, Monster1.posy, 500, 100, 5, Player.attackdamage);
    WindowStyle.drawWindow(5, 5, 235, 12);
    Font.drawText(7, 7, Player.temp);
    DrawPlayerStats();
    BattleName();
    FlipScreen();
    Delay(1000);
    Player.techloop = Player.techloop - 1;
    BattleMenu_TechMonster1();
    }
    else
    {
    IsMonster1Dead(); 
    BattleMenu_Itemused();
    }
  }
}  

function BattleMenu_TechMonster2()
{
  if (Player.techmp == true)
  {
    if (Player.temp == "Dual Combo")
    {
    ReduceMp("Lv1");
    Player.techmp = false;
    }
    else if (Player.temp == "Quad Slice")
    {
    ReduceMp("Lv2.5");
    Player.techmp = false;
    }
    else if (Player.temp == "Dash")
    {
    ReduceMpDash();
    Player.techmp = false;

    Player.tempposx = Monster2.posx;
    Player.tempposy = Monster2.posy;
    DashFrames();
    }
  }

Monster1.temppres = false;
Monster2.temppres = false;
Monster3.temppres = false;
Monster4.temppres = false;
  if (Player.temp == "Sword Drain")
  { 
    Battle.math = Math.random()/5 + Player.techpower;

    Player.tempposx = Monster2.posx;
    Player.tempposy = Monster2.posy;
    SwordDrainFrames();

    RenderMap();

    Player.attackdamage = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster2.defence);
      if (Player.attackdamage > Monster2.hp)
      {
      Player.attackdamage = Monster2.hp;
      }
    Monster2.hp = Monster2.hp - Player.attackdamage;

    WindowStyle.drawWindow(5, 5, 235, 12);
    Font.drawText(7, 7, Player.temp);

    RenderMap();
    Font.drawTextBox (Monster2.posx, Monster2.posy, 500, 100, 5, Player.attackdamage);
    DrawPlayerStats();
    BattleName();
    FlipScreen();
    Delay(1000);
    HealPerson(Player.attackdamage);
    IsMonster2Dead(); 
    BattleMenu_Itemused();
  }
  else
  {  
    if (Player.techloop > 0)
    {
      if (Player.temp == "Dash")
      {
      }
      else
      {
      ShowPersonFight();
      Player.tempposx = Monster2.posx;
      Player.tempposy = Monster2.posy;
      SlashFrames("Slash", 20, 20);
      }

    Battle.math = Math.random()/5 + Player.techpower;

    Player.attackdamage = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster2.defence);
    Monster2.hp = Monster2.hp - Player.attackdamage;

    RenderMap();
    WindowStyle.drawWindow(5, 5, 235, 12);
    Font.drawText(7, 7, Player.temp);    
    Font.drawTextBox (Monster2.posx, Monster2.posy, 500, 100, 5, Player.attackdamage);
    DrawPlayerStats();
    BattleName();
    FlipScreen();
    Delay(1000);
    Player.techloop = Player.techloop - 1;
    BattleMenu_TechMonster2();
    }
    else
    {
    IsMonster2Dead(); 
    BattleMenu_Itemused();
    }
  }
}  
function BattleMenu_TechMonster3()
{
  if (Player.techmp == true)
  {
    if (Player.temp == "Dual Combo")
    {
    ReduceMp("Lv1");
    Player.techmp = false;
    }
    else if (Player.temp == "Quad Slice")
    {
    ReduceMp("Lv2.5");
    Player.techmp = false;
    }
    else if (Player.temp == "Dash")
    {
    ReduceMpDash();
    Player.techmp = false;

    Player.tempposx = Monster3.posx;
    Player.tempposy = Monster3.posy;
    DashFrames();
    }
  }
  
Monster1.temppres = false;
Monster2.temppres = false;
Monster3.temppres = false;
Monster4.temppres = false;
  if (Player.temp == "Sword Drain")
  { 
    Battle.math = Math.random()/5 + Player.techpower;

    Player.tempposx = Monster3.posx;
    Player.tempposy = Monster3.posy;
    SwordDrainFrames();

    RenderMap();

    Player.attackdamage = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster3.defence);
      if (Player.attackdamage > Monster3.hp)
      {
      Player.attackdamage = Monster3.hp;
      }
    Monster3.hp = Monster3.hp - Player.attackdamage;

    WindowStyle.drawWindow(5, 5, 235, 12);
    Font.drawText(7, 7, Player.temp);

    RenderMap();
    Font.drawTextBox (Monster3.posx, Monster3.posy, 500, 100, 5, Player.attackdamage);
    DrawPlayerStats();
    BattleName();
    FlipScreen();
    Delay(1000);
    HealPerson(Player.attackdamage);
    IsMonster3Dead(); 
    BattleMenu_Itemused();
  }
  else
  {  
    if (Player.techloop > 0)
    {
      if (Player.temp == "Dash")
      {
      }
      else
      {
      ShowPersonFight();
      Player.tempposx = Monster3.posx;
      Player.tempposy = Monster3.posy;
      SlashFrames("Slash", 20, 20);
      }
    Battle.math = Math.random()/5 + Player.techpower;

    Player.attackdamage = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster3.defence);
    Monster3.hp = Monster3.hp - Player.attackdamage;

    RenderMap();
    Font.drawTextBox (Monster3.posx, Monster3.posy, 500, 100, 5, Player.attackdamage);
    WindowStyle.drawWindow(5, 5, 235, 12);
    Font.drawText(7, 7, Player.temp);    
    DrawPlayerStats();
    BattleName();
    FlipScreen();
    Delay(1000);
    Player.techloop = Player.techloop - 1;
    BattleMenu_TechMonster3();
    }
    else
    {
    IsMonster3Dead(); 
    BattleMenu_Itemused();
    }
  }
}  
function BattleMenu_TechMonster4()
{
  if (Player.techmp == true)
  {
    if (Player.temp == "Dual Combo")
    {
    ReduceMp("Lv1");
    Player.techmp = false;
    }
    else if (Player.temp == "Quad Slice")
    {
    ReduceMp("Lv2.5");
    Player.techmp = false;
    }
    else if (Player.temp == "Dash")
    {
    ReduceMpDash();
    Player.techmp = false;

    Player.tempposx = Monster4.posx;
    Player.tempposy = Monster4.posy;
    DashFrames();
    }
  }
  
Monster1.temppres = false;
Monster2.temppres = false;
Monster3.temppres = false;
Monster4.temppres = false;
  if (Player.temp == "Sword Drain")
  { 
    Battle.math = Math.random()/5 + Player.techpower;

    Player.tempposx = Monster4.posx;
    Player.tempposy = Monster4.posy;
    SwordDrainFrames();

    RenderMap();

    Player.attackdamage = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster4.defence);
      if (Player.attackdamage > Monster4.hp)
      {
      Player.attackdamage = Monster4.hp;
      }
    Monster4.hp = Monster4.hp - Player.attackdamage;

    WindowStyle.drawWindow(5, 5, 235, 12);
    Font.drawText(7, 7, Player.temp);

    RenderMap();
    Font.drawTextBox (Monster4.posx, Monster4.posy, 500, 100, 5, Player.attackdamage);
    DrawPlayerStats();
    BattleName();
    FlipScreen();
    Delay(1000);
    HealPerson(Player.attackdamage);
    IsMonster4Dead(); 
    BattleMenu_Itemused();
  }
  else
  {  
    if (Player.techloop > 0)
    {
      if (Player.temp == "Dash")
      {
      }
      else
      {
      ShowPersonFight();
      Player.tempposx = Monster4.posx;
      Player.tempposy = Monster4.posy;
      SlashFrames("Slash", 20, 20);
      }
    Battle.math = Math.random()/5 + Player.techpower;

    Player.attackdamage = Math.floor(Player.tempstr*Player.tempattack*Battle.math/Monster4.defence);
    Monster4.hp = Monster4.hp - Player.attackdamage;

    RenderMap();
    Font.drawTextBox (Monster4.posx, Monster4.posy, 500, 100, 5, Player.attackdamage);
    WindowStyle.drawWindow(5, 5, 235, 12);
    Font.drawText(7, 7, Player.temp);    
    DrawPlayerStats();
    BattleName();
    FlipScreen();
    Delay(1000);
    Player.techloop = Player.techloop - 1;
    BattleMenu_TechMonster4();
    }
    else
    {
    IsMonster4Dead(); 
    BattleMenu_Itemused();
    }
  }
}  

function ReduceMpDash()
{
  if (Player.active == "Player1")
  {
  Player.mp = Player.mp - 2;
  }
  else if (Player.active == "Player2")
  {
  Player2.mp = Player2.mp - 2;
  }
  else if (Player.active == "Player3")
  {
  Player3.mp = Player3.mp - 2;
  }
}
function CheckMpDash()
{
  if (Player.active == "Player1")
  {
  Player.actmp = Player.mp;
  }
  if (Player.active == "Player2")
  {
  Player.actmp = Player2.mp;
  }
  if (Player.active == "Player3")
  {
  Player.actmp = Player3.mp;
  }
Player.needmp = 2;
}

function BattleSpecialBardSong()
{
RenderMap();

  BattleName(); 
  DrawPlayerStats();
  
  var BattleMenuItem = new Menu();
  BattleMenuItem.font         = Font;
  BattleMenuItem.window_style = WindowStyle;
  BattleMenuItem.arrow        = Arrow;
  if (Player.active == "Player1")
  {
    if (Playerbard.warsong == true)
    {
    BattleMenuItem.addItem("War Song", BattleSpecialBardWarsong);
    }
    if (Playerbard.intimidate == true)
    {
    BattleMenuItem.addItem("Intimidate", BattleSpecialBardintimidate);
    }
    if (Playerbard.animals == true)
    {
    BattleMenuItem.addItem("Animals", BattleSpecialBardAnimals);
    }
    if (Playerbard.resonance == true)
    {
    BattleMenuItem.addItem("Resonance", BattleSpecialBardResonance);
    }
  }
  else if (Player.active == "Player2")
  {
    if (Player2bard.warsong == true)
    {
    BattleMenuItem.addItem("War Song", BattleSpecialBardWarsong);
    }
    if (Player2bard.intimidate == true)
    {
    BattleMenuItem.addItem("Intimidate", BattleSpecialBardintimidate);
    }
    if (Player2bard.animals == true)
    {
    BattleMenuItem.addItem("Animals", BattleSpecialBardAnimals);
    }
    if (Player2bard.resonance == true)
    {
    BattleMenuItem.addItem("Resonance", BattleSpecialBardResonance);
    }
  }
  else if (Player.active == "Player3")
  {
    if (Player3bard.warsong == true)
    {
    BattleMenuItem.addItem("War Song", BattleSpecialBardWarsong);
    }
    if (Player3bard.intimidate == true)
    {
    BattleMenuItem.addItem("Intimidate", BattleSpecialBardintimidate);
    }
    if (Player3bard.animals == true)
    {
    BattleMenuItem.addItem("Animals", BattleSpecialBardAnimals);
    }
    if (Player3bard.resonance == true)
    {
    BattleMenuItem.addItem("Resonance", BattleSpecialBardResonance);
    }
  }
  BattleMenuItem.addItem("Cancel", GoToActivePlayer);  
  BattleMenuItem.execute(5, 355, 235, 120);
}

